package com.mycompany.project.client;

import com.google.gwt.event.shared.GwtEvent;

/**
 *  @author Laboratorio Tv Collaborativa/Contenuti Digitali --> Sardegna District --> Crs4 --> Sardegna Ricerche
 *  
 *  This class extends a GwtEvent class and implements @SaStria AnnotationSave event and in particular mode the 
 *  fire the onAnnotationSaved event. This onAnnotationSaved event should be fired when a user execute double click
 *  an annotation tag on video player by @SaStria tools interface. This class is responsible for handle and
 *  dispatch the onAnnotationMoved event.  
 */
public class AnnotationSaveEvent extends GwtEvent<AnnotationSaveEventHandler> {
	public static Type<AnnotationSaveEventHandler> TYPE=new Type<AnnotationSaveEventHandler>();
	
	/**
	 * Constructor
	 */
	public AnnotationSaveEvent() {
		
	}
	
	
	
	/**
	 * This method return the system parameter TYPE. Type class is used to register events with the HandlerManager.
	 * Type is parameterized by the handler type in order to make the addHandler method type safe.
	 *  Gets the type associated with this event.
	 */
	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<AnnotationSaveEventHandler> getAssociatedType() {
		// TODO Auto-generated method stub
		return TYPE;
	}
	
	
	
	/**
	 * This method run and dispatch the onAnnotationMoved event.
	 * Should only be called by HandlerManager.
	 * @param handler: handler of AnnotationSaveEventHandler. 
	 */
	@Override
	protected void dispatch(AnnotationSaveEventHandler handler) {
		handler.onAnnotationSaved(this);
		
	}

}
